<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ page import="com.msmall.base.util.ConstantDB" language="java"%>
<c:set var="AVALIABLE" value="<%=ConstantDB.AVALIABLE%>"></c:set>
<c:set var="UNAVALIABLE" value="<%=ConstantDB.UNAVALIABLE%>"></c:set>
<c:set var="KEYWORD_TYPES_LETTER" value="<%=ConstantDB.KEYWORD_TYPES_LETTER%>"></c:set>
<c:set var="KEYWORD_TYPES_IMAGE" value="<%=ConstantDB.KEYWORD_TYPES_IMAGE%>"></c:set>

<c:set var="KEYWORD_TYPE_SITE_INDEX_WIKI_MOTHER" value="<%=ConstantDB.KEYWORD_TYPE_SITE_INDEX_WIKI_MOTHER%>"></c:set>
<c:set var="KEYWORD_TYPE_SITE_INDEX_WIKI_BABY" value="<%=ConstantDB.KEYWORD_TYPE_SITE_INDEX_WIKI_BABY%>"></c:set>
<c:set var="KEYWORD_TYPE_SITE_WIKI_MOTHER_BABY" value="<%=ConstantDB.KEYWORD_TYPE_SITE_WIKI_MOTHER_BABY%>"></c:set>

<c:set var="KEYWORD_TYPE_COOKBOOK_MOTHER" value="<%=ConstantDB.KEYWORD_TYPE_COOKBOOK_MOTHER%>"></c:set>
<c:set var="KEYWORD_TYPE_COOKBOOK_BABY" value="<%=ConstantDB.KEYWORD_TYPE_COOKBOOK_BABY%>"></c:set>
<c:set var="KEYWORD_TYPE_COOKBOOK_MOTHER_BABY" value="<%=ConstantDB.KEYWORD_TYPE_COOKBOOK_MOTHER_BABY%>"></c:set>

<c:set var="KEYWORD_TYPE_SITE_INDEX_TOP" value="<%=ConstantDB.KEYWORD_TYPE_SITE_INDEX_TOP%>"></c:set>

<script type="text/javascript">
function toUpdate(){
	var array = [];
	var url = "<c:url value='/admin/keyword/update.do' />";
	sns.toUpdate(url, array, 'ck_keywords','keywordid');
}
function removeKeyword(){
	var array = [];
	var url = "<c:url value='/admin/keyword/remove.do' />";
	sns.dynaRemove(url, array, 'ck_keywords','ck_keywords','id-keyword-');
}
</script>
<div class="bu">
<form action="<c:url value='/admin/keyword/query.do'/>" action="POST">
	版块
	<select name="keyword.module">
		<option value="0">NULL</option>
		<option value="${KEYWORD_TYPE_SITE_INDEX_WIKI_MOTHER}">整站首页妈妈字典关键字</option>
		<option value="${KEYWORD_TYPE_SITE_INDEX_WIKI_BABY}">整站首页宝宝字典关键字</option>
		<option value="${KEYWORD_TYPE_SITE_WIKI_MOTHER_BABY}">妈妈和宝宝字典关键字混合</option>
		
		<option value="${KEYWORD_TYPE_COOKBOOK_MOTHER}">妈妈的食谱关键字</option>
		<option value="${KEYWORD_TYPE_COOKBOOK_BABY}">宝宝的食谱关键字</option>
		<option value="${KEYWORD_TYPE_COOKBOOK_MOTHER_BABY}">妈妈和宝宝食谱关键字混合</option>
		
		<option value="${KEYWORD_TYPE_SITE_INDEX_TOP}">整站首页TOP下的关键字</option>
	</select>
	<br/>
	<input type="submit" name="查询" value="查询"/>
</form>
</div>
<div class="bu">
<button onclick="location.href='<c:url value="/admin/keyword/create.do"/>'"><fmt:message key="common.create"/></button>&nbsp;&nbsp;
<button onclick="toUpdate()"><fmt:message key="common.update"/></button>&nbsp;&nbsp;
<button onclick="removeKeyword()" title="DELETE"><fmt:message key="common.delete"/></button>&nbsp;&nbsp;
</div>
创建用于页面部分显示某些关键字，其在页面上将创建&gt;a class="XX" target="_blank" href=""..<br/>
<div>
<table id="t_keyword_list" width="100%"  border="0" cellpadding="0" cellspacing="0" class="pub_list01">
	<thead>
		<tr>
			<th width="50px" class="tdCenter">
			</th>
			<th width="75px" class="tdCenter">类型</th>
			<th width="75px" class="tdCenter">版块</th>
			<th width="75px" class="tdCenter">关键字</th>
			<th width="75px" class="tdCenter">样式(只能适合 a)</th>
			<th width="75px" class="tdCenter">URL</th>
			<th width="75px" class="tdCenter">排序(1为最高序)</th>
			<th width="75px" class="tdCenter">是否可用</th>
		</tr>
	</thead>
	<tbody>
		<c:forEach var="keyword" items="${page.items}" varStatus="status">
		<tr id="id-keyword-${keyword.keywordid}">
			<td class="tdCenter">
				<input type="checkbox" name="ck_keywords" id="ck_<c:out value='${keyword.keywordid}' />" value="${keyword.keywordid}"></input>
			</td>
			<td class="tdCenter">
				<c:if test="${keyword.types == KEYWORD_TYPES_LETTER}">
					文字
				</c:if>
				<c:if test="${keyword.types == KEYWORD_TYPES_IMAGE}">
					图片
				</c:if>
			</td>
			<td class="tdCenter">
				<c:if test="${keyword.module == KEYWORD_TYPE_SITE_INDEX_WIKI_MOTHER}">
					整站首页妈妈字典关键字
				</c:if>
				<c:if test="${keyword.module == KEYWORD_TYPE_SITE_INDEX_WIKI_BABY}">
					整站首页宝宝字典关键字
				</c:if>
				<c:if test="${keyword.module == KEYWORD_TYPE_SITE_WIKI_MOTHER_BABY}">
					妈妈和宝宝字典关键字混合
				</c:if>
				
				<c:if test="${keyword.module == KEYWORD_TYPE_COOKBOOK_MOTHER}">
					妈妈的食谱关键字
				</c:if>
				<c:if test="${keyword.module == KEYWORD_TYPE_COOKBOOK_BABY}">
					宝宝的食谱关键字
				</c:if>
				<c:if test="${keyword.module == KEYWORD_TYPE_COOKBOOK_MOTHER_BABY}">
					妈妈和宝宝食谱关键字混合
				</c:if>
				
				<c:if test="${keyword.module == KEYWORD_TYPE_SITE_INDEX_TOP}">
					整站首页TOP下的关键字
				</c:if>
			</td>
			<td class="tdCenter">
				<c:out value="${keyword.name}"></c:out>
			</td>
			<td class="tdCenter">
				<c:out value="${keyword.style}"></c:out>
			</td>
			<td class="tdCenter">
				<c:out value="${keyword.keywordUrl}"></c:out>
			</td>
			<td class="tdCenter">
				<c:out value="${keyword.orders}"></c:out>
			</td>
			<td class="tdCenter">
				<c:if test="${keyword.enabled == UNAVALIABLE}">
					<fmt:message key="common.notenabled"/>
				</c:if>
				<c:if test="${keyword.enabled == AVALIABLE}">
					<fmt:message key="common.enabled"/>
				</c:if>
			</td>
		</tr>
		</c:forEach>
	</tbody>
</table>
</div>
<br/>